html,
body {
  height: 100%;
  padding: 0;
  margin: 0;
}

body {
  background-color: #1d1d1d;
  width: 100%;
  float: left;
}

.animated-button {
  position: relative;
  display: block;
  width: 200px;
  height: 100px;
  margin: 50px auto;
  box-sizing: border-box;
  text-align: center;
  font-size: 24px;
  line-height: 100px;
  color: #fed75d;
}

.animated-button::after, .animated-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  box-sizing: border-box;
  border: 1px solid #fed75d;
  transition: clip-path .5s ease-in-out;
}

.animated-button::before {
  clip-path: inset(0 170px 70px 0);
}

.animated-button::after {
  clip-path: inset(70px 0 0 170px);
}

.animated-button:hover::after, .animated-button:hover::before {
  clip-path: inset(0 0 0 0);
}

.animated-button1 {
  position: relative;
  display: block;
  width: 200px;
  height: 200px;
  margin: 50px auto;
  box-sizing: border-box;
  text-align: center;
  font-size: 24px;
  line-height: 200px;
  color: #fed75d;
}

.animated-button1::after, .animated-button1::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  box-sizing: border-box;
  border: 1px solid #fed75d;
  transition: clip-path .5s ease-in-out;
  clip-path: inset(70% 0 0 30%);
  animation: border-animate 5s linear infinite;
}

.animated-button1::after {
  animation-delay: -2.5s;
}

@keyframes border-animate {
  0%,
  100% {
    clip-path: inset(0 0 199px 0);
  }
  25% {
    clip-path: inset(0 199px 0 0);
  }
  50% {
    clip-path: inset(199px 0 0 0);
  }
  75% {
    clip-path: inset(0 0 0 199px);
  }
}

.border-box {
  width: 200px;
  height: 200px;
  text-align: center;
  font-weight: bold;
  font-size: 20px;
  line-height: 200px;
  color: white;
  margin: 50px auto;
  border: 5px solid;
  background-image: linear-gradient(45deg, #ffadad, #ffd6a5, #fdffb6, #9bf6ff, #a0c4ff, #bdb2ff, #ffc6ff);
  border-image: linear-gradient(45deg, #ffadad, #ffd6a5, #fdffb6, #9bf6ff, #a0c4ff, #bdb2ff, #ffc6ff) 1;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: border-animate1 3s linear infinite;
}

@keyframes border-animate1 {
  from {
    filter: hue-rotate(0deg);
  }
  to {
    filter: hue-rotate(360deg);
  }
}
